package com.boss.salary.service.impl;

import com.boss.common.entity.PageDTO;
import com.boss.framework.dto.PaginationDTO;
import com.boss.salary.dao.IPersonExtDao;
import com.boss.salary.dao.IReportByTheUnitDao;
import com.boss.salary.entity.PersonExt;
import com.boss.salary.entity.ReportByTheUnit;
import com.boss.salary.service.IReportByTheUnitService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class ReportByTheUnitServiceImpl implements IReportByTheUnitService {
    /**
     * 引入日志框架常量
     */
    private final static Logger logger = LoggerFactory.getLogger(ReportByTheUnitServiceImpl.class);

    @Autowired
    private IReportByTheUnitDao dao;
    /**
     * 获取应发工资  和  实发工资  单位名称
     * @param paginationDTO
     * @param queryParam
     * @return
     */
    @Override
    public PageDTO queryunitSubmitSituationQueryList(PaginationDTO paginationDTO, Map<String, Object> queryParam) {
        //月结工资查询分页
        List<ReportByTheUnit> wage = dao.getWageMonthHistoryPage(paginationDTO, queryParam);
        //月结工资查询分页total
        int total = dao.getWageMonthHistoryTotal(queryParam);
        PageDTO<ReportByTheUnit> pageDTO = new PageDTO<>();
        pageDTO.setRows(wage);
        pageDTO.setTotal(total);
        return pageDTO;
    }
}
